package com.weblearning.tliasweb.exception;

import com.weblearning.tliasweb.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//异常全局处理

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)  //捕获所以异常
    public Result ex(Exception e){
        e.printStackTrace();
        return  Result.error("异常，请联系管理员");
    }
}
